package cn.wolfcode.p2p.bussness.service;

import cn.wolfcode.p2p.base.query.QueryObject;
import cn.wolfcode.p2p.bussness.domain.BidRequest;
import com.github.pagehelper.PageInfo;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

public interface IBidRequestService {
    int save(BidRequest bidRequest);

    int update(BidRequest bidRequest);

    BidRequest get(Long id);

    PageInfo queryList(QueryObject qo);

    /**
     * 提交申请贷款
     * @param bidRequest
     */
    void apply(BidRequest bidRequest);

    /**
     * 审核操作
     * @param id    申请的ID
     * @param state 审核的状态
     * @param publishTime   发布时间
     * @param remark    审核意见
     */
    void publishAudit(Long id, Integer state, Date publishTime, String remark);

    List queryPublishPendngBidRequests();

    List<BidRequest> queryPublishPendngBidInOneHourRequest();

    /**
     * 分组查询标的类型的集合
     * @param bidRequestType    标的类型
     * @return
     */
    List<BidRequest>  queryIndexData(int bidRequestType);

    /**
     * 投标
     * @param bidRequestId  借款对象的ID
     * @param amount        投资金额
     */
    void bid(Long bidRequestId, BigDecimal amount);

    /**
     * 满标一审
     * @param id    满标一审对象ID
     * @param state 审核状态
     * @param remark 风控意见
     */
    void audit1(Long id, Integer state, String remark);

    /**
     * 满标二审
     * @param id 满标二审对象ID
     * @param state 审核状态
     * @param remark 风控意见
     */
    void audit2(Long id, Integer state, String remark);

    /**
     * 发布体验标
     * @param bidRequest    借款对象
     */
    void applyExp(BidRequest bidRequest);
}
